package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.RegulatorConsumeMapper;
import com.ruoyi.consume.domain.RegulatorConsume;
import com.ruoyi.consume.service.IRegulatorConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-23
 */
@Service
public class RegulatorConsumeServiceImpl implements IRegulatorConsumeService
{
    @Autowired
    private RegulatorConsumeMapper regulatorConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param regulatorConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public RegulatorConsume selectRegulatorConsumeById(Long regulatorConsumeId)
    {
        return regulatorConsumeMapper.selectRegulatorConsumeById(regulatorConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param regulatorConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<RegulatorConsume> selectRegulatorConsumeList(RegulatorConsume regulatorConsume)
    {
        return regulatorConsumeMapper.selectRegulatorConsumeList(regulatorConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param regulatorConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertRegulatorConsume(RegulatorConsume regulatorConsume)
    {
        regulatorConsume.setCreateTime(DateUtils.getNowDate());
        return regulatorConsumeMapper.insertRegulatorConsume(regulatorConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param regulatorConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updateRegulatorConsume(RegulatorConsume regulatorConsume)
    {
        regulatorConsume.setUpdateTime(DateUtils.getNowDate());
        return regulatorConsumeMapper.updateRegulatorConsume(regulatorConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param regulatorConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorConsumeByIds(Long[] regulatorConsumeIds)
    {
        return regulatorConsumeMapper.deleteRegulatorConsumeByIds(regulatorConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param regulatorConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorConsumeById(Long regulatorConsumeId)
    {
        return regulatorConsumeMapper.deleteRegulatorConsumeById(regulatorConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<RegulatorConsume> getUserName(){
        return regulatorConsumeMapper.getUserName();
    }
}
